
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<script>
    if('edit' == '<%=request.getParameter("action")%>'){
        let row = $('#dg').datagrid('getSelected');
        $.ajax({
            type:"GET",
            url:"/lab00/ServletCourse?action=getone",
            data:{cno:row.cno},
            success:function (ret)
            {
                let result = eval("(" +ret+")");
                console.log(result.data);
                if(result.code == '200'){
                    $('#cno').textbox({
                        readonly:true,
                        required:true,
                        validType: ''
                    })
                    $('#ff').form('load',result.data);
                }
                else{
                    alert(result.msg);
                }
            }
        })

    }


</script>
<form id="ff" method="post" style="padding: 5px">
    <div style="margin-bottom:10px">
        <input class="easyui-textbox" id="cno" name="cno" style="width:85%" data-options="label:'课程号:',required:true,
        validType:{
        remote:['/lab00/ServletCourse?action=exists','cno'] },invalidMessage:'已经存在'">
    </div>
    <div style="margin-bottom:10px">
        <input class="easyui-textbox" id="cname" name="cname" style="width:85%" data-options="label:'课程名:'">
    </div>
    <div style="margin-bottom:10px">
        <input class="easyui-textbox" id="teacher" name="teacher" style="width:85%" data-options="label:'教师:'">
    </div>
    <div style="margin-bottom:10px">
        <input class="easyui-textbox" id="semester" name="semester" style="width:85%" data-options="label:'学期:'">
    </div>
    <div style="margin-bottom:10px">
        <input class="easyui-textbox" id="week" name="week" style="width:85%" data-options="label:'周次:'">
    </div>
    <div style="margin-bottom:10px">
        <input class="easyui-textbox" id="cday" name="cday" style="width:85%" data-options="label:'星期:'">
    </div>
    <div style="margin-bottom:10px">
        <input class="easyui-textbox" id="cstime" name="cstime" style="width:85%" data-options="label:'上课时间:'">
    </div>
    <div style="margin-bottom:10px">
        <input class="easyui-textbox" id="cetime" name="cetime" style="width:85%" data-options="label:'下课时间:'">
    </div>
    <div style="margin-bottom:10px">
        <input class="easyui-textbox" id="caddress" name="caddress" style="width:85%" data-options="label:'上课地点:'">
    </div>

</form>